<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jspf/links.jspf"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><c:out value="${cityName}"/></title>
</head>
<body>
	<div id="wrapper">
		<!-- header -->
		<div id="header">
			<%@ include file="/WEB-INF/jspf/header.jspf"%>
		</div>

		<!-- top menu -->
		<div id="menu">
			<%@ include file="/WEB-INF/jspf/menu.jspf"%>
		</div>

		<!-- bodywrap -->
		<div id="bodytop">&nbsp;</div>
		
		<div id="bodywrap">
		
		<c:if test="${pageContext.response.locale == 'en'}">
			<c:set var="datePattern" value="MM/dd/yyyy"/>
		</c:if>
		<c:if test="${pageContext.response.locale == 'ru'}">
			<c:set var="datePattern" value="dd-MM-yyyy"/>
		</c:if>
		
			<div id="contentbody">
				<p><c:out value="${cityName}"/></p>
				<hr>
				
				<p>Woeid: <c:out value="${city.woeid}"></c:out> - <spring:message code="company.city.woeid"/></p>
				
				<p>
				<spring:message code="company.city.connections"/> 
				<c:forEach var="finishCity" items="${connects}" varStatus="status">
					<a href='/company/pages/city/${finishCity.key}'><c:out value="${finishCity.value}"></c:out></a> &nbsp
				</c:forEach>
				</p>
				
				<p><spring:message code="company.route.weather.wind.speed"/>: <c:out value="${city.weather.windSpeed}"></c:out><spring:message code="company.route.mps"/></p>
			
				<p><spring:message code="company.weather.wind.direction"/>: <c:out value="${windDirection}"></c:out></p>
				
				<p><spring:message code="company.route.weather.temperature"/>: <c:out value="${city.weather.temperature}"></c:out>&deg;C</p>
				
				<p><spring:message code="company.weather.date"/>: <fmt:formatDate pattern="${datePattern}" value="${city.weather.date}" /></p>
			
				<br>
				<p style="text-align: center;"><spring:message code="company.weather.forecast"/>:</p> 
				
				<c:forEach var="forecast" items="${city.weather.forecast}" varStatus="status">
					
					<br>		
					<p><spring:message code="company.weather.date"/>: <fmt:formatDate pattern="${datePattern}" value="${forecast.date}" /></p>
							
					<table width="100%">
						<tbody>
							<tr>
								<td><spring:message code="company.weather.forecast.day"/></td> 
								<td style="text-align: right;">${days[status.count - 1]}</td>
							</tr>
							<c:if test="${pageContext.response.locale == 'en'}">
								<tr>
									<td><spring:message code="company.weather.forecast.description"/></td>
									<td style="text-align: right;"><c:out value="${forecast.description}"/></td>
								</tr>
							</c:if>
							<tr>
								<td><spring:message code="company.weather.forecast.low"/></td> 
								<td style="text-align: right;"><c:out value="${forecast.low}"></c:out>&deg;C </td>
							</tr>
							<tr>
								<td><spring:message code="company.weather.forecast.high"/></td>  
								<td style="text-align: right;"><c:out value="${forecast.high}"></c:out>&deg;C </td>
							</tr>
						</tbody>
					</table>
				</c:forEach>
				
			</div>
			
		</div>
		<div id="bodybottom">&nbsp;</div>
		<div id="footer">
			<%@ include file="/WEB-INF/jspf/footer.jspf"%>
		</div>
		<div id="sidemenu">
			<div id="smtop">&nbsp;</div>
			<div id="smtitle">
				<h1>
					<spring:message code="company.menu" />
				</h1>
			</div>
			<ul class="normal">
				<li><a href="${pageContext.request.contextPath}/pages/routes" ><spring:message
							code="company.menu.search" /></a></li>
				<li><a href="${pageContext.request.contextPath}/pages/cities" class="currentpage"><spring:message code="company.menu.cities" /></a></li>
				<li><a href="${pageContext.request.contextPath}/pages/about"><spring:message code="company.menu.about" /></a></li>
			</ul>
			<%@ include file="/WEB-INF/jspf/adminMenu.jspf"%>
			<div id="smbottom">&nbsp;</div>
		</div>
		<!-- end side menu -->
	</div>
	<!-- end wrapper -->

</body>
</html>